//
//  RootController.m
//  BCNADemo
//
//  Created by 马东朝 on 2018/5/7.
//  Copyright © 2018年 马东朝. All rights reserved.
//

#import "RootController.h"

@interface RootController ()

@end

@implementation RootController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self addSubControllers];
}
- (void)addSubControllers{
    //a.初始化一个tabBar控制器
    
    //设置控制器为Window的根控制器
    
    NSMutableArray *vcArr = [NSMutableArray arrayWithCapacity:0];
    self.tabBar.barTintColor = [UIColor colorWithHexString:@"#0b0d1a"];
    self.tabBar.tintColor = [UIColor whiteColor];
    
    //b.创建子控制器
    HomePageController *c1=[[HomePageController alloc]init];
    
    
    c1.tabBarItem.title=StringWithKey(@"RootVC0");
    c1.tabBarItem.image=[UIImage imageNamed:@"jiasu_2@3x.png"];
    
    //b.创建子控制器
//    UIViewController *c2=[[UIViewController alloc]init];
//
//    c2.tabBarItem.title=@"购买";
//    c2.tabBarItem.image=[UIImage imageNamed:@"goumai_1@3x.png"];
    
    //b.创建子控制器
    MineController *c3=[[MineController alloc]init];
    
    c3.tabBarItem.title=StringWithKey(@"RootVC1");
    c3.tabBarItem.image=[UIImage imageNamed:@"wode_1@3x.png"];
    
    UINavigationController *n1 = [[UINavigationController alloc] initWithRootViewController:c1];
//    UINavigationController *n2 = [[UINavigationController alloc] initWithRootViewController:c2];
    UINavigationController *n3 = [[UINavigationController alloc] initWithRootViewController:c3];
    //self.viewControllers=@[c1,c2,c3];
    [vcArr addObject:n1];
    [vcArr addObject:n3];
    self.viewControllers=vcArr;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
